local jilang = fk.CreateSkill{
    name = "ym2__jilang",
}
Fk:loadTranslationTable{
    ["ym2__jilang"] = "击浪",
    [":ym2__jilang"] = "每回合你使用第二张牌后摸两张牌，第三张牌后视为未使用过牌。",
    ["@ym2__jilang-turn"] = "击浪",

    ["$ym2__jilang1"] = "哈哈！今天就把魏军战船拍碎在这江滩之上！",
    ["$ym2__jilang2"] = "长江后浪推前浪，一浪更比一浪强！",
    ["~ym2__lingfeng"] = "兄长获罪，吾承其爵，更当以死报君...",
}
jilang:addEffect(fk.CardUseFinished,{
    anim_type = "drawcard",
    can_trigger = function(self, event, target, player, data)
        if player:hasSkill(self) and target == player then
            local y = player:getMark("@ym2__jilang-turn")
            local room = player.room
            local logic = room.logic
            local e = logic:getCurrentEvent()
            local turn_event = e:findParent(GameEvent.Turn, false)
            if turn_event == nil then return false end
            room:setPlayerMark(player, "@ym2__jilang-turn", y + 1)
            local mark = player:getTableMark("ym2__jilang-turn")
            table.insert(mark, data.card.name)
            table.insert(mark, data.card.trueName)
            room:setPlayerMark(player, "ym2__jilang-turn", #mark > 0 and mark or 0)
            y = player:getMark("@ym2__jilang-turn")
            return y == 2 or y == 3
        end
    end,
    on_cost = Util.TrueFunc,
    on_use = function (self, event, target, player, data)
        local y = player:getMark("@ym2__jilang-turn")
        if y == 2 then
            player:drawCards(2, jilang.name)
        elseif y == 3 then
            local mark = player:getTableMark("ym2__jilang-turn")
            for _, card in pairs(mark) do
                player:setCardUseHistory(card, 0, Player.HistoryPhase)
                player:setCardUseHistory(card, 0, Player.HistoryTurn)
                player:setCardUseHistory(card, 0, Player.HistoryRound)
                player:setCardUseHistory(card, 0, Player.HistoryGame)
            end
            player.room:setPlayerMark(player, "@ym2__jilang-turn", 0)
            player.room:setPlayerMark(player, "ym2__jilang-turn", 0)
        end
    end,
})
return jilang